<?php

class Domain51_Service_Delicious_Posts_Container
{
    private $_meta = array();
    private $_data = array();
    
    public function __construct(SimpleXMLElement $xml, $type = 'post') {
        foreach ($xml->attributes() as $key => $value) {
            $this->_meta[$key] = (string)$value;
        }
        
        $i = 0;
        foreach ($xml->$type as $data_key => $data) {
            foreach ($data->attributes() as $key => $value) {
                $this->_data[$i][$key] = (string)$value;
            }
            $i++;
        }
    }
    
    public function meta() {
        return $this->_meta;
    }
    
    public function data() {
        return $this->_data;
    }
    
}

?>